home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / border.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  59 lines

  1. #include "border.h"
  2.  
  3. Border::Border(rect coordinates, char* h, BORDERS b_type, BORDERS hdr_b_type,
  4.                int s, int pat)
  5.     : Header(h, screenXL(coordinates.width() - 1)
  6.          - area[b_type].origin.X - area[b_type].corner.X
  7.              - area[hdr_b_type].origin.X - area[hdr_b_type].corner.X
  8.          - 2 * s, hdr_b_type, pat),
  9.       Frame(coordinates, b_type, s)
  10.       {
  11.       }
  12. ////////////////////
  13. void Border::show()
  14.     {
  15.     Frame::show();
  16.     Header::show(loc(screenXL(rectangle.origin.X)
  17.     + area[border_type].origin.X,
  18.     screenYT(rectangle.origin.Y)
  19.     + area[border_type].origin.Y) + shadow);
  20.     }
  21. /////////////////////
  22. void Border::hilite()                 { Frame::hilite(); }
  23. void Border::unhilite()               { Frame::unhilite(); }
  24. void Border::set_header(char* h)
  25.     {
  26.     if(header != NULL)
  27.         {
  28.     delete header;
  29.     header = strdup(h);
  30.     }
  31.     }
  32. /////////////////////////
  33. void Border::set_type(BORDERS type)   { border_type = type; }
  34. /////////////////////////
  35. /*
  36. void main()
  37.     {
  38.     if(!init_KNOW_HOW())
  39.         return;
  40.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  41.     bar(0, 0, getmaxx(), getmaxy());
  42.  
  43.     Border b(rect(1, 1, 40, 6), "HELLO, World !", BUTTON_BORDER,
  44.         SHOW_BORDER, 16, 16);
  45.     b.show();
  46.     Border b1(rect(1, 7, 40, 12), "HELLO, World !", STANDART_BORDER,
  47.         STANDART_BORDER, 16, 16);
  48.     b1.show();
  49.     Border b2(rect(1, 13, 40, 17), "HELLO, World !", SHOW_BORDER,
  50.         NO_BORDER, 16, 16);
  51.     b2.show();
  52.     Border b3(rect(1, 18, 40, 22), "HELLO, World !", PRESS_BORDER,
  53.         BUTTON_BORDER, 16, 16);
  54.     b3.show();
  55.  
  56.     close_KNOW_HOW();
  57.     closegraph();
  58.     }
  59. */